home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 2 #5 / utv2n5s1.d64 / grid locked (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1988-01-01  |  7.6 KB  |  249 lines

  1. 0 rem grid locked
  2. 50 poke 45,peek(174):poke 46,peek(175):clr
  3. 100 dima(44)
  4. 110 poke53269,0:poke53281,0:gosub1650
  5. 120 poke53281,0
  6. 130 s=54272:forss=stos+24:pokess,0:next:pokes+24,15
  7. 140 pokes+5,12:pokes+6,9:pokes+12,12:pokes+13,9:pokes+7,2:pokes+8,3.5
  8. 150 print"[147]"
  9. 160 a$(1,1)="[156][213][201][157][157][202][203][145]"
  10. 170 a$(1,2)="[213][201][157][157][202][203][145]"
  11. 180 a$(1,3)="[213][201][157][157][202][203][145]"
  12. 190 a$(1,4)="[158][213][201][157][157][202][203][145]"
  13. 200 a$(2,1)="[156][176][174][157][157][173][189][145]"
  14. 210 a$(2,2)="[176][174][157][157][173][189][145]"
  15. 220 a$(2,3)="[176][174][157][157][173][189][145]"
  16. 230 a$(2,4)="[158][176][174][157][157][173][189][145]"
  17. 240 a$(3,1)="[156][206][205][157][157][205][206][145]"
  18. 250 a$(3,2)="[206][205][157][157][205][206][145]"
  19. 260 a$(3,3)="[206][205][157][157][205][206][145]"
  20. 270 a$(3,4)="[158][206][205][157][157][205][206][145]"
  21. 280 a$(4,1)="[156][205][206][157][157][206][205][145]"
  22. 290 a$(4,2)="[205][206][157][157][206][205][145]"
  23. 300 a$(4,3)="[205][206][157][157][206][205][145]"
  24. 310 a$(4,4)="[158][205][206][157][157][206][205][145]"
  25. 320 print"          [176][192][192][178][192][192][178][192][192][178][192][192][174]"
  26. 330 print"          [221]  [221]  [221]  [221]  [221]"
  27. 340 print"          [221]  [221]  [221]  [221]  [221]"
  28. 350 print"          [171][192][192][219][192][192][219][192][192][219][192][192][179]"
  29. 360 print"          [221] [160][221][160][160][221][160][160][221][160][160][221]"
  30. 370 print"          [221]  [221][160][160][221][160][160][221][160][160][221]"
  31. 380 print"          [171][192][192][219][192][192][219][192][192][219][192][192][179]"
  32. 390 print"          [221]  [221]  [221]  [221]  [221]"
  33. 400 print"          [221]  [221]  [221]  [221]  [221]"
  34. 410 print"          [171][192][192][219][192][192][219][192][192][219][192][192][179]"
  35. 420 print"          [221] [160][221][160][160][221][160][160][221][160][160][221]"
  36. 430 print"          [221]  [221][160][160][221][160][160][221][160][160][221]"
  37. 440 print"          [173][192][192][177][192][192][177][192][192][177][192][192][189]"
  38. 450 print"     [159]grid locked by joel epstein":gosub 1020
  39. 460 print""tab(28)"color:"
  40. 470 printtab(27)"[156] [146]  [146]  [146] [158] [146]"
  41. 480 print""tab(28)"function:[158]"
  42. 490 printtab(26)"place[157][157][157][157][157]clear 1[157][157][157][157][157][157][157]clear all[157][157][157][157][157][157][157][157][157]quit"
  43. 500 print""tab(28)"shape:"
  44. 510 printtab(27)"[158][209]  [146] [218] [214]"
  45. 520 print"_[157]";:x=0:a=1
  46. 530 j=peek(56320):x=x+1:get m$
  47. 540 if(j=125anda<4)or(m$=""anda<4)then a=a+1:print" [157]_[157]";
  48. 550 if(j=126anda>1)or(m$="[145]"anda>1)then a=a-1:print" [157][145]_[157]";
  49. 560 if(j=111andx>10anda=3)or(m$=chr$(13)anda=3)thengosub2080:clr:print"[147]":goto100
  50. 570 if(j=111andx>10anda=2)or(m$=chr$(13)anda=2)thengosub2080:cl=1:goto750
  51. 580 if(j=111andx>10anda=4)or(m$=chr$(13)anda=4)then print" ":gosub2030:goto520
  52. 590 if(j=111andx>10anda=1)or(m$=chr$(13)anda=1)thengosub2080:goto 610
  53. 600 goto 530
  54. 610 print""tab(27)"^[157]";:a=1:x=0
  55. 620 j=peek(56320):x=x+1:getm$
  56. 630 if(j=119anda<4)or(m$=""anda<4)then print"  ^[157]";:a=a+1
  57. 640 if(j=123anda>1)or(m$="[157]"anda>1)then print" [157][157][157]^[157]";:a=a-1
  58. 650 if(j=111 and x>10)orm$=chr$(13)then gosub2080:goto670
  59. 660 goto620
  60. 670 print""tab(27)"^[157]";:b=1:x=0
  61. 680 j=0:j=peek(56320):x=x+1:getm$
  62. 690 if(j=119andb<4)or(m$=""andb<4)then print"  ^[157]";:b=b+1
  63. 700 if(j=123andb>1)or(m$="[157]"andb>1)then print" [157][157][157]^[157]";:b=b-1
  64. 710 if(j=111 andx>10)orm$=chr$(13) then gosub2080:goto 730
  65. 720 goto680
  66. 730 nn=a*10+b:ifa(nn)=1thengosub940:goto900
  67. 740 a(nn)=1
  68. 750 print"[158]^[157]";
  69. 760 r=1:c=1:x=0
  70. 770 j=peek(56320):x=x+1:getm$
  71. 780 if(j=119andc<4)or(m$=""andc<4)then c=c+1:print"[192][158]^[157]";
  72. 790 if(j=123andc>1)or(m$="[157]"andc>1)then c=c-1:print"[192][158][157][157][157][157]^[157]";
  73. 800 if(j=111andx>10)orm$=chr$(13)then gosub2080:goto 840
  74. 810 if(j=125andr<4)or(m$=""andr<4)then r=r+1:print"[192][158][157]^[157]";
  75. 820 if(j=126andr>1)or(m$="[145]"andr>1)then r=r-1:print"[192][158][157][145][145][145]^[157]";
  76. 830 goto 770
  77. 840 ifcl=1thengosub1510:goto900
  78. 850 if b(r,c)<>0 then 770
  79. 860 gosub 1140:ifmu=1thenmu=0:goto900
  80. 870 if b(r,c)=0 then b(r,c)=nn:ct=ct+1
  81. 880 print"[192][157][145][145][157]";a$(b,a):gosub1020:goto890
  82. 890 if ct=16 then gosub 1560
  83. 900 print"  [157][157]  [157][157]  [157][157]  [157][157]  "
  84. 910 print""tab(27)"           "
  85. 920 print""tab(27)"              "
  86. 930 goto 520
  87. 940 gosub2090:print" that has been taken already, try again"
  88. 950 gosub 960:return
  89. 960 print"[158]  press joystick button or hit return":x=0:j=0
  90. 970 j=peek(56320):x=x+1:getm$
  91. 980 if(j=111 and x>15)or(m$=chr$(13))then goto 1000
  92. 990 goto 970
  93. 1000 print"";:forx=1to4:print"                                      ";:next
  94. 1010 return
  95. 1020 print"";:for f=1 to 4
  96. 1030 for g=1 to 4
  97. 1040 if f=1 then print" [156]";
  98. 1050 if f=2 then print" ";
  99. 1060 if f=3 then print" ";
  100. 1070 if f=4 then print" [158]";
  101. 1080 if g=1 then print"[209]";:ifa(f*10+g)<>0 then print"[157][151][209]";
  102. 1090 if g=2 then print" [146]";:ifa(f*10+g)<>0then print"[157][151] [146]";
  103. 1100 if g=3 then print"[218]";:ifa(f*10+g)<>0 then print"[157][151][218]";
  104. 1110 if g=4 then print"[214]";:ifa(f*10+g)<>0 then print"[157][151][214]";
  105. 1120 if rd=1 then return
  106. 1130 next:print" ";:next:return
  107. 1140 rem *** check here ***
  108. 1150 cn=(int(nn/10)):cm=(nn-((int(nn/10))*10))
  109. 1160 for x=1 to 4
  110. 1170 if int(b(r,x)/10)=cn then c=x:gosub1400:return
  111. 1180 if(b(r,x)-((int(b(r,x)/10))*10))=cmthenc=x:gosub 1400:return
  112. 1190 next
  113. 1200 for x=1 to 4
  114. 1210 if int(b(x,c)/10)=cn then r=x:gosub1400:return
  115. 1220 if(b(x,c)-((int(b(x,c)/10))*10))=cmthenr=x:gosub 1400:return
  116. 1230 next
  117. 1240 if r<>c then 1290
  118. 1250 for x=0 to 4
  119. 1260 if int(b(x,x)/10)=cn then c=x:r=x:gosub1400:return
  120. 1270 if(b(x,x)-((int(b(x,x)/10))*10))=cmthenc=x:r=x:gosub 1400:return
  121. 1280 next
  122. 1290 ev=0:p=4:fory=1to4
  123. 1300 ifr=y and c=p then ev=ev+1
  124. 1310 p=p-1
  125. 1320 next
  126. 1330 if ev=0then mu=0:goto 1390
  127. 1340 p=4:fory=1to4
  128. 1350 if int(b(y,p)/10)=cn then r=y:c=p:gosub1400:return
  129. 1360 if(b(y,p)-((int(b(y,p)/10))*10))=cmthenr=y:c=p:gosub1400:return
  130. 1370 p=p-1
  131. 1380 next
  132. 1390 rd=0:return
  133. 1400 rem *** give message here ***
  134. 1410 gosub 2090
  135. 1420 rd=1:print"[192][157][145][145][157]";
  136. 1430 print"     you can't put the";
  137. 1440 f=(int(nn/10)):g=(nn-((int(nn/10))*10)):a(f*10+g)=0
  138. 1450 gosub 1040:print" here"
  139. 1460 print" because of the ";
  140. 1470 f=(int(b(r,c)/10)):g=(b(r,c)-((int(b(r,c)/10))*10))
  141. 1480 dm=a(b(r,c)):a(b(r,c))=0:gosub1040:a(b(r,c))=1
  142. 1490 print" in row";r;"column";c
  143. 1500 mu=1:gosub960:return
  144. 1510 rd=0:print"[192][157][157][145][145]  [157][157]  "
  145. 1520 ng=b(r,c):f=int(ng/10):g=ng-((int(ng/10))*10):a(f*10+g)=0
  146. 1530 gosub 1020
  147. 1540 a(b(r,c))=0:b(r,c)=0
  148. 1550 ct=ct-1:cl=0:nn=0:f=0:g=0:return
  149. 1560 print"               hooray!!!"
  150. 1570 print"     you solved this crazy puzzle!"
  151. 1580 forux=1to30:poke53280,ux:foruu=1to50:next:next
  152. 1590 print"[158]   do you want to play again (y or n)"
  153. 1600 getpl$:ifpl$=""then 1600
  154. 1610 if pl$="y" then 1640
  155. 1620 if pl$="n"then 2100
  156. 1630 goto 1600
  157. 1640 clr:run
  158. 1650 poke53281,0:poke53280,0:print"[147]":sys949
  159. 1660 print"[156]grid locked"
  160. 1740 get a$:ifa$=""then 1740
  161. 1750 if a$="n"then return
  162. 1760 if a$="y"then 1780
  163. 1770 goto 1740
  164. 1780 print"[147]the object of this game is to fill the":print
  165. 1790 print"grid with various shapes of different":print
  166. 1800 print"colors.  there is a catch, however.":print
  167. 1810 print"the grid is 4x4 - there are 4 different":print
  168. 1820 print"shapes and 4 different colors.  to be":print
  169. 1830 print"successful in solving this grid, you":print
  170. 1840 print"must not have a shape or a color":print
  171. 1850 print"duplicated in any vertical, horizontal,":print
  172. 1860 print"or diagonal row of 4. ":print:print:print
  173. 1870 print"  press space bar to continue reading"
  174. 1880 geta$:ifa$=""ora$<>" "thengoto1880
  175. 1890 print"[147]use joystick in #2 or cursor keys to:":print
  176. 1900 print"1. [158]place (put a shape on the board)":print
  177. 1910 print"2. [158]clear 1 (remove one piece from board)"
  178. 1920 print"3. [158]clear all (clear board and try again)"
  179. 1930 print"4. [158]quit (to exit the game)":print
  180. 1940 print"guide the pointer in the various menus":print
  181. 1950 print"by either using the cursor keys or the":print
  182. 1960 print"joystick.  to select an item on the menu"
  183. 1970 print"either press the joystick button or hit":print
  184. 1980 print"return. when the desired shape is chosen"
  185. 1990 print"position arrow on grid and press return":print
  186. 2000 print"press space bar to begin this crazy game"
  187. 2010 geta$:ifa$=""ora$<>" "thengoto2010
  188. 2020 return
  189. 2030 gosub2080:print"are you sure you want to quit (y or n) ?"
  190. 2040 getpl$:ifpl$=""then 2040
  191. 2050 if pl$="n" then print"                                         ":return
  192. 2060 if pl$="y"then 2100
  193. 2070 goto 2040
  194. 2080 pokes+1,30:pokes,100:pokes+4,21:forx=1to200:next:pokes+4,20:return
  195. 2090 pokes+11,33:forx=1to200:next:pokes+11,32:return
  196. 2100 f=20:no=1:nt=10:dimpd(10,4):nn=1
  197. 2110 v=53248:i=249:rem video & image #
  198. 2120 poke 53280,0:poke v+21,0
  199. 2130 poke 53281,14
  200. 2140 s=54272:forsd=stos+24:pokes,0:next
  201. 2150 pokes+24,15:pokes+2,0:pokes+5,129:pokes+6,65
  202. 2160 pokes+7,85:pokes+8,36:pokes+12,136:pokes+13,129
  203. 2170 sys 907:poke v+21,0
  204. 2180 poke v,100:poke v+1,120:rem posit
  205. 2190 poke v+39,11:rem color
  206. 2200 poke v+29,0 :rem place vert
  207. 2210 poke v+23,0 :rem expan hori
  208. 2220 poke v+21,1:xl=0:rem turn on
  209. 2230 j=peek(56320):vv=peek(v+1):vh=peek(v):vo=peek(v+16)
  210. 2240 hp=sgn(jand4)-sgn(jand8)
  211. 2250 ifhd<>hpthenifhp=1theni=249
  212. 2260 ifhd<>hpthenifhp=-1theni=253
  213. 2270 ifi=252theni=249:no=2:nt=10
  214. 2280 ifi=256theni=253:no=2:nt=10
  215. 2290 ifvo=1andvh=>59andhp=1thengoto2230
  216. 2300 ifvo=0andvh<=20andhp=-1thengoto2230
  217. 2310 vp=sgn(jand1)-sgn(jand2):ifwk=1andzz<65thenvp=.5
  218. 2320 ok=(f>51)
  219. 2330 ifvp=1andvv=>156thengoto2230
  220. 2340 ifvp=-1andvv<=94thengoto2230
  221. 2350 pokev+1,vv+vp*2
  222. 2360 pokev+16,ok*(-1)
  223. 2370 pokev,f*5+(ok*256)
  224. 2380 poke2040,i:ifhp=0andvp=0thengoto2420
  225. 2390 nt=nt+26
  226. 2400 ifnt>88thennt=10
  227. 2410 pokes+4,129:pokes+1,no:pokes,nt:i=i+1:forgg=1to1:next:pokes+4,128
  228. 2420 ifj=111andxl>10thengosub2450
  229. 2430 hd=hp:f=f+hd:xl=xl+1:ifwk=1 then return
  230. 2440 hd=hp:f=f+hd:xl=xl+1:goto2230
  231. 2450 xl=0:ifvo=0andvv=94andvh>=35andvh<=50thenrun
  232. 2460 ifvo=0andvv=94andvh>=115andvh<=130thenmm=2:a$="one more time":goto2500
  233. 2470 ifvo=0andvv=94andvh>=195andvh<=210thenmm=3:a$="stroop":goto2500
  234. 2480 ifvo=1andvv=94andvh>=19andvh<=34thenmm=4:gosub2550:if z=2 thenreturn
  235. 2490 return
  236. 2500 poke53280,0:poke53281,0:pokev+21,0
  237. 2510 print"[147][156]    please wait while file loads..."
  238. 2520 poke 43,1:poke44,16:poke4096,0
  239. 2530 loada$,8
  240. 2550 print"[158]   are you sure you want to quit?"
  241. 2560 get a$:if a$="" then 2560
  242. 2570 ifa$="n"thenz=2
  243. 2575 ifz=2thenprint"[144]    viking technologies, inc. ";
  244. 2580 if z=2 thenprint"   ";:z=0:return
  245. 2590 if a$="y" then 2610
  246. 2600 goto 2560
  247. 2610 clr:load"upt.reboot",8
  248. 2620 rem **** return to uptime ****
  249.